﻿<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="FieldRef[@FieldType='TakeAPictureField']" mode="Text_body">
    <xsl:param name="thisNode" select="." />
    <xsl:choose>
      <xsl:when test="$thisNode/@*[name()=current()/@Name] != ''">
        <a title="View details">
          <xsl:attribute name="href">
            <xsl:value-of select="$thisNode/@*[name()=current()/@Name]"/>
          </xsl:attribute>
          <img width="150" border="0">
            <xsl:attribute name="src">
              <xsl:value-of select="$thisNode/@*[name()=current()/@Name]"/>
            </xsl:attribute>
          </img>
        </a>  
      </xsl:when>
      <xsl:otherwise>
        No picture
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
</xsl:stylesheet>